import {
	mapState,
	mapMutations
} from "vuex"
import {
	getUserInfo
} from "./api.js"
export default {
	data() {
		return {
			userInfo: {}
		}
	},
	onShow() {
		this.onShowCall();
	},
	onLoad(options) {

	},
	computed:{
		
	},
	methods: {
		//   vuex储存信息
		...mapMutations([
			"setShopInfo", //设置店铺信息
			"setShopPhone", //设置电话
			"setShopStatus", //设置店铺状态
			"initdishListMut", //设置购物车订单
			"setStoreInfo",
			"setBaseUserInfo", //设置用户基本信息
			"setLodding",
			"setToken", //设置token
			"setDeliveryFee", //设置配送费
		]),
		// 从vuex信息
		...mapState([
			"shopInfo", //店铺信息
			"shopPhone", //电话
			"orderListData",
			"baseUserInfo", //用户信息
			"lodding",
			"token", //token
			"deliveryFee", //配送费
		]),
		
		orderListPage(){
			uni.navigateTo({
				url: "/pages/order/orderList/index",
			})
		},
		onShowCall(){
			getUserInfo().then((res) => {
				this.userInfo = res.data
			}).catch((err) =>{})
		},
		goOrder() {
			uni.navigateTo({
				url: "/pages/order/index",
			})
		},
		// 删除商品
		deleteItem(index) {
			// this.goodsList.splice(index, 1);
		}
	},

}